package com.zero.basic.util;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

public class JsonCreator {

	private static ObjectMapper objectMapper = new ObjectMapper();

	public static ObjectNode generateJsonObj() {
		return objectMapper.createObjectNode();
	}

	public static ArrayNode generateJsonArray() {
		return objectMapper.createArrayNode();
	}
	
	public static JsonNode readTreeNode(String dataString) throws JsonProcessingException, IOException{
		return objectMapper.readTree(dataString);
	}
}
